import {isMobileTerminal} from '@/utils/flexible.js';

export default {
  categorys: (state) => state.category.categorys,
  themeType: (state) => state.theme.themeType,
  themeType: (state) => state.theme.themeType,
  historys: (state) => state.search.historys,
  token: (state) => state.user.token,
  userInfo: (state) => state.user.userInfo,
  routeType: (state) => {
    if(!isMobileTerminal.value) {
      return 'none';
    }
    return state.app.routeType
  },
  searchText: (state) => state.app.searchText,
  currentCategory: (state) => state.app.currentCategory,
  currentCategoryIndex: (state, getters) => {
    return getters.categorys.findIndex((item) => item.id === getters.currentCategory.id);
  }
};
